//
//  SuccessCommitViewController.m
//  OneCreditTreasure
//
//  Created by iOS Tedu on 16/8/30.
//
//

#import "SuccessCommitViewController.h"
#import "CollectionFoldersViewController.h"

@interface SuccessCommitViewController ()
@property (nonatomic, strong) UILabel *infoLB;
@end

@implementation SuccessCommitViewController
#pragma mark - 生命周期 life cycle
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (instancetype)init {
    if (self = [super init]) {
        [self infoLB];
        self.title = @"提交成功";
        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回收藏夹" style:UIBarButtonItemStylePlain target:self action:@selector(backToCollectionFolders:)];
    }
    return self;
}

#pragma mark - 方法 methods
- (void)backToCollectionFolders:sender {
    NSArray *views = self.navigationController.viewControllers;
    for (UIViewController *view in views) {
        if ([view isKindOfClass:[CollectionFoldersViewController class]]) {
            [self.navigationController popToViewController:view animated:YES];
        }
    }
}

#pragma mark - 懒加载 lazy loading
- (UILabel *)infoLB {
    if(_infoLB == nil) {
        _infoLB = [[UILabel alloc] init];
        [self.view addSubview:_infoLB];
        [_infoLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(0);
        }];
        _infoLB.text = @"提交成功,请耐心等待业务员";
        _infoLB.font = [UIFont systemFontOfSize:16 * AUTO_WIDTH];
        _infoLB.textAlignment = NSTextAlignmentCenter;
    }
    return _infoLB;
}

@end
